package com.alili_tv.system.controller;

import com.alili_tv.system.common.R;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.Serializable;

@RestController
@RequestMapping(value = "/test", produces = "application/json")
public class TestController {
    @GetMapping
    public R<User> getUserInfo() {
        User user = new User(1, "夏明", 23, "男");
        double d = 1.1D;
        long l = 2L;
        int c = 2;
        float f = 1F;
        short s = 1;

        ObjectMapper mapper = new ObjectMapper();
        return R.success(user);

    }
    public static class User implements Serializable {
        private Integer id;
        private String name;
        private Integer age;
        private String gender;

        public User() {
        }

        public User(Integer id, String name, Integer age, String gender) {
            this.id = id;
            this.name = name;
            this.age = age;
            this.gender = gender;
        }

        public Integer getId() {
            return id;
        }

        public void setId(Integer id) {
            this.id = id;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Integer getAge() {
            return age;
        }

        public void setAge(Integer age) {
            this.age = age;
        }

        public String getGender() {
            return gender;
        }

        public void setGender(String gender) {
            this.gender = gender;
        }
    }

}
